unit ClienteRecordFr;

{$mode objfpc}{$H+}

interface

uses
  Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs,
  StdCtrls, DBCtrls, ActnList, Buttons, ExtCtrls, ComCtrls, ACBrCEP,
  MainRecordFr;

type

  { TClienteRecordFrame }

  TClienteRecordFrame = class(TMainRecordFrame)
    ACBrCEP1: TACBrCEP;
    btBuscar: TBitBtn;
    IdCliente: TDBEdit;
    DBEdit10: TDBEdit;
    DBEdit11: TDBEdit;
    DBEdit14: TDBEdit;
    DBEdit15: TDBEdit;
    DBEdit16: TDBEdit;
    DBEdit17: TDBEdit;
    DBEdit18: TDBEdit;
    IdPessoa: TDBEdit;
    DBEdit23: TDBEdit;
    DBEdit24: TDBEdit;
    DBEdit3: TDBEdit;
    DBEdit4: TDBEdit;
    DBEdit5: TDBEdit;
    DBEdit6: TDBEdit;
    DBEdit7: TDBEdit;
    DBEdit8: TDBEdit;
    DBEdit9: TDBEdit;
    DBGroupBox1: TDBGroupBox;
    DBMemo1: TDBMemo;
    status_cliente: TDBRadioGroup;
    ClienteDBGroupBox: TDBGroupBox;
    Label1: TLabel;
    Label10: TLabel;
    Label11: TLabel;
    Label12: TLabel;
    Label13: TLabel;
    Label14: TLabel;
    Label15: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    Label5: TLabel;
    Label6: TLabel;
    Label7: TLabel;
    Label8: TLabel;
    Label9: TLabel;
    ToolButton4: TToolButton;
    procedure btBuscarClick(Sender: TObject);
    procedure IdPessoaChange(Sender: TObject);

  private
    { private declarations }
  public
    { public declarations }
  end;

implementation

uses Initializator, MainFr, ClienteDM, RelatorioDM, MainDM;

{ TClienteRecordFrame }


procedure TClienteRecordFrame.btBuscarClick(Sender: TObject);
begin
  TheControl.ShowForeignFrame(TMainFrame(PessoaSearchFrame));
end;

procedure TClienteRecordFrame.IdPessoaChange(Sender: TObject);
begin
  if (ClienteData.DataSetState() in [mdsEditing, mdsInserting]) then begin
    if IdPessoa.Text <> '' then begin
      ClienteData.ClienteZQuery.FieldByName('id_cliente').AsString := IdPessoa.Text;
      status_cliente.ItemIndex := 0;
    end;
  end;
end;

initialization
  {$I clienterecordfr.lrs}

end.

